<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <title>结伴 - 驴骡窝</title>
    <link href="https://css.mafengwo.net/css/cv/mobile+css+head:mobile+css+ui^YVw^1550829726.css" rel="stylesheet" type="text/css"/>
    <link rel="stylesheet" href="/js/bootstrap-4.1.1-dist/css/bootstrap.min.css">
    <script src="/js/jquery/jquery.min.js"></script>
    <script src="/js/bootstrap-4.1.1-dist/js/bootstrap.min.js"></script>
    <link rel="stylesheet" href="/css/font/css/font-awesome.min.css"/>
    <link rel="stylesheet" href="/css/reset.css"/>
    <link rel="stylesheet" href="/css/strategyCatalogs.css"/>
    <script src="/js/plugins/jrender/jrender.min.js"></script>
    <link rel="stylesheet" href="/js/plugins/dialog2/dialog.css" />
    <script src="/js/plugins/dialog2/dialog.min.js"></script>
    <script src="/js/common.js"></script>

</head>
<script>
    $(function () {
        //获取共有多少旅行计划
        $.get(baseUrl+"/companions/companionCount",function(data){
            $("#companionCount").html(data);
        });
        //获取共有多少人参与旅行计划
        $.get(baseUrl+"/companions/companionPerson",function(data){
            $("#companionPerson").html(data);
        });

        var currentPage = 1;
        var travelsDate = [];
        var pages;//总页数
        var flag = false;//表示当前没有在查询
        $(function () {
            function loadCompanion() {
                if (flag) {
                    return;
                }
                flag = true;
                //获取结伴数据
                $.get(baseUrl+"/companions", {currentPage: currentPage}, function (data) {
                    $.merge(travelsDate, data.list);
                    var ret = {"list": travelsDate}
                    $(".companions").renderValues(ret,{
                        getHref: getHref
                    });
                    currentPage++;
                    pages = data.pages;
                    flag = false;//表示查询完成
                });
            }
            loadCompanion();
            $(window).scroll(function () {
                if ($(window).height() + $(document).scrollTop() + 1 >= $(document).height()) {
                    if (pages >= currentPage) {
                        loadCompanion();
                    } else {
                        $(document).dialog({
                            type: 'notice',
                            infoText: '亲,到底了',
                            autoClose: 2500,
                            position: 'bottom'
                        });
                    }
                }
            })
        })
    })
</script>
<body style="background: url('/upload/2.bmp')">
<div id="pos38"></div>
<header class="head2home" style="color: #eeeeee;background: url('/upload/2.bmp')">
    <br>
    <a href="/index.html" style="color: #eea447">
        <span><i class="fa fa-chevron-left fa-2x"></i></span>
    </a>
    <div class="rBtn">
        <a href="/index.html" class="home">首页</a>
    </div>
</header>

<link href="https://css.mafengwo.net/mobile/css/together/together.css?1526627473" rel="stylesheet" type="text/css"/>
<section class="container" data-from="">
    <div class="top-num">
        <img width="100%" src="https://images.mafengwo.net/mobile/images/together/topNum-bg.jpg">
        <div class="vam">
            <ul>
                <li>
                    <span><em id="companionCount">406006</em><br>个旅行计划</span>
                    <span><em id="companionPerson">638888</em><br>个人参与</span>
                    <!--<span><em>11694</em><br>个目的地</span>-->
                </li>
            </ul>
        </div>
    </div>

    <div class="lists companions">
        <div class="row" render-loop="list">
            <div class="col-6">
                <a data-url="/companionContent.html?id=" render-key="list.id" render-fun="getHref">
                    <div class="cover">
                        <img render-src="list.coverUrl" src="img/user/bg.jpeg">
                        <div class="title">
                            <h3 render-html="list.title">巴黎之行</h3>
                            <span><span render-html="list.days">3-7</span>天</span>
                        </div>
                        <span class="departure-date"><span render-html="list.goTime">09月26日</span> 出发</span>
                    </div>
                    <div class="info" style="background-color: white">
                        <span class="avatar"><img render-src="list.author.headImgUrl" src="img/user/head.jpg"></span>
                        <span class="name" render-html="list.author.nickName">喵喵</span>
                        <span class="place" render-html="list.place">广州</span>
                        <p class="txt" render-html="list.author.sign">先自我介绍下南京姑娘一枚，90后，巨蟹座，可爱又迷人的反派...</p>
                    </div>
                </a>
            </div>
        </div>
    </div>



    <div class="fixed-btm ">
        <div class="btn-group">
            <a class="btn-add "  href="/mine/myCompanion.html">我的结伴</a>
            <a class="btn-add " href="/mine/editCompanions.html">发起结伴</a>
        </div>

    </div>
</section>

</body>
</html>
